/* Layout */
import Layout from '../views/layout/Layout';

// utils
import { mapToArray } from '@/utils/base';

const _import = require(`./_import_${process.env.NODE_ENV}`);

// 三方支付设置
export const paySetType = {
  rechargeTab: 'recharge-tab', /* 三方入款设置 */
  rechargeAdd: 'recharge-add', /* 新增三方入款商户 */
  rechargeEdit: 'recharge-edit', /* 编辑三方入款商户 */
  rechargeDelete: 'recharge-delete', /* 删除三方入款商户 */
  rechargeStatus: 'recharge-status', /* 开关三方入款商户 */
  rechargeKeyShow: 'recharge-key-show', /* 三方入款密钥展示 */
  rechargeUrlShow: 'recharge-url-show', /* 三方入款URL展示 */

  // 改名为 三方入款应用
  thirdRechargeTab: 'third-recharge-set', /* 第三方充值设置 */
  thirdRechargeAdd: 'third-recharge-add', /* 添加三方充值应用 */
  thirdRechargeEdit: 'third-recharge-edit', /* 编辑三方充值应用 */
  thirdRechargeDele: 'third-recharge-del', /* 删除三方充值应用 */
  thirdRechargeStatusSet: 'third-recharge-status-set', /* 三方充值应用上下架处理 */
  thirdRechargeTopping: 'third-recharge-topping', /* 三方充值应用置顶处理 */
  thirdRechargeRecomm: 'third-recharge-recommend', /* 三方充值应用推荐处理 */

  withdrawTab: 'withdraw-tab', /* 三方出款设置 */
  withdrawAdd: 'withdraw-add', /* 新增三方出款商户 */
  withdrawSwitch: 'withdraw-switch', /* 下架三方出款商户 */
  withdrawEdit: 'withdraw-edit', /* 编辑三方出款商户 */
  withdrawDelete: 'withdraw-delete', /* 删除三方出款商户 */
  withdrawStatus: 'withdraw-status', /* (批量)开启/关闭/三方出款商户 */
  withdrawKeyShow: 'withdraw-key-show', /* 三方出款密钥展示 */
  withdrawUrlShow: 'withdraw-url-show', /* 三方出款URL展示 */

  merchantRankTab: 'merchant-rank-tab', /* 商户成功排行 */
  openShowMerchant: 'open-show-merchant', // 开启关闭充值通道展示
};

// 银行卡支付设置
export const payBankSetType = {
  add: 'add', /* 添加银行卡支付设置 */
  edit: 'edit', /* 编辑银行卡支付设置 */
  delete: 'delete', /* 删除银行卡支付设置 */
};

// 层级设置
export const payLevelSetType = {
  add: 'add', /* 新增层级 */
  updateUserLevel: 'update-user-level', /* 修改会员层级 */
  update: 'update', /* 修改层级 */
  delete: 'delete', /* 删除层级 */
  lockedUser: 'locked-user', /* 锁定用户数量 */
};

// 入款配置总览
export const payIncomeSetType = {
  thirdAccount: 'third-account', /* 三方账户总数 */
};

// 出款配置总览
export const payOutgoingsSetType = {
};

export default [
  {
    path: '/pay',
    component: Layout,
    // meta: { roles: [] }, // you can set roles in root nav
    redirect: 'noredirect',
    name: 'pay',
    meta: {
      title: '三方支付',
      icon: 'international',
      roles: [],
    },
    children: [
      {
        path: 'pay-set',
        name: 'pay-set',
        component: _import('finance/payment/setting'),
        meta: {
          title: '三方支付设置',
          notLog: true,
          roles: mapToArray(paySetType),
        },
      },
      {
        path: 'pay-bank-pay-set',
        name: 'pay-bank-pay-set',
        component: _import('finance/payment/banks'),
        hidden: true,
        meta: {
          title: '银行卡支付设置',
          roles: mapToArray(payBankSetType),
        },
      },
      {
        path: 'pay-level-set',
        name: 'pay-level-set',
        component: _import('finance/userLevel/index'),
        meta: {
          title: '层级设置',
          roles: mapToArray(payLevelSetType),
        },
      },
      {
        path: 'pay-income-set-list',
        name: 'pay-income-set-list',
        component: _import('finance/paymentConfigOverview/rechargePayment'),
        hidden: true,
        meta: {
          title: '入款配置总览',
          notLog: true,
          roles: mapToArray(payIncomeSetType),
        },
      },
      {
        path: 'pay-outgoings-set-list',
        name: 'pay-outgoings-set-list',
        component: _import('finance/paymentConfigOverview/withdrawPayment'),
        hidden: true,
        meta: {
          title: '出款配置总览',
          roles: mapToArray(payOutgoingsSetType),
        },
      },

    ],
  },
];
